<!doctype html>
<html lang="zh-CN">
<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    
    <meta name="referrer" content="no-referrer-when-downgrade">
    

    <title>《在Flutter中的开发小技巧2》 | 早起的年轻人</title>
    <meta property="og:title" content="《在Flutter中的开发小技巧2》 - 早起的年轻人">
    <meta property="og:type" content="article">
        
    <meta property="article:published_time" content='2021-06-24T21:41:33&#43;08:00'>
        
        
    <meta property="article:modified_time" content='2021-06-24T21:41:33&#43;08:00'>
        
    <meta name="Keywords" content="Flutter，golang,go语言,go语言笔记,飞雪无情,java,android,博客,项目管理,python,软件架构,公众号,小程序">
    <meta name="description" content="《在Flutter中的开发小技巧2》">
        
    <meta name="author" content="luckly">
    <meta property="og:url" content="https://luckly.work/%E5%9C%A8Flutter%E4%B8%AD%E7%9A%84%E5%BC%80%E5%8F%91%E5%B0%8F%E6%8A%80%E5%B7%A72/">
    <link rel="shortcut icon" href='/favicon.ico'  type="image/x-icon">

    <link rel="stylesheet" href='/css/normalize.css'>
    <link rel="stylesheet" href='/css/style.css'>
    <script type="text/javascript" src="//cdn.bootcdn.net/ajax/libs/jquery/3.4.1/jquery.min.js"></script>

    
    
    
        <link href="https://cdn.bootcdn.net/ajax/libs/fancybox/3.5.7/jquery.fancybox.min.css" rel="stylesheet">
    
    
    
    
        <link rel="stylesheet" href='/css/douban.css'>
    
        <link rel="stylesheet" href='/css/other.css'>
    
</head>

<link rel="stylesheet"
      href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.2.0/styles/default.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.2.0/highlight.min.js"></script>
<body>
    <header id="header" class="clearfix">
    <div class="container">
        <div class="col-group">
            <div class="site-name ">
                
                    <a id="logo" href="https://luckly.work/">
                        早起的年轻人
                    </a>
                
                <p class="description">专注于Flutter、Android、Java、Go语言(golang)、移动互联网、项目管理、软件架构</p>
            </div>
            <div>
                <nav id="nav-menu" class="clearfix">
                    <a class="" href="https://luckly.work/">首页</a>
                    
                    <a  href="https://luckly.work/categories/" title="分类">分类</a>
                    
                    <a  href="https://luckly.work/tags/" title="标签">标签</a>
                    
                    <a  href="https://luckly.work/archives/" title="归档">归档</a>
                    
                    <a  href="https://luckly.work/about/" title="关于我">关于我</a>
                    
                    <a  href="https://github.com/ITmxs/" title="github">github</a>
                    
                </nav>
            </div>
        </div>
    </div>
</header>

    <div id="body">
        <div class="container">
            <div class="col-group">

                <div class="col-8" id="main">
                    
<div class="res-cons">
    <style type="text/css">
    .post-toc {
        position: fixed;
        width: 200px;
        margin-left: -210px;
        padding: 5px 10px;
        font-family: Athelas, STHeiti, Microsoft Yahei, serif;
        font-size: 12px;
        border: 1px solid rgba(0, 0, 0, .07);
        border-radius: 5px;
        background-color: rgba(255, 255, 255, 0.98);
        background-clip: padding-box;
        -webkit-box-shadow: 1px 1px 2px rgba(0, 0, 0, .125);
        box-shadow: 1px 1px 2px rgba(0, 0, 0, .125);
        word-wrap: break-word;
        white-space: nowrap;
        -webkit-box-sizing: border-box;
        box-sizing: border-box;
        z-index: 999;
        cursor: pointer;
        max-height: 70%;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .post-toc .post-toc-title {
        width: 100%;
        margin: 0 auto;
        font-size: 20px;
        font-weight: 400;
        text-transform: uppercase;
        text-align: center;
    }

    .post-toc .post-toc-content {
        font-size: 15px;
    }

    .post-toc .post-toc-content>nav>ul {
        margin: 10px 0;
    }

    .post-toc .post-toc-content ul {
        padding-left: 20px;
        list-style: square;
        margin: 0.5em;
        line-height: 1.8em;
    }

    .post-toc .post-toc-content ul ul {
        padding-left: 15px;
        display: none;
    }

    @media print,
    screen and (max-width:1057px) {
        .post-toc {
            display: none;
        }
    }
</style>
<div class="post-toc" style="position: absolute; top: 188px;">
    <h2 class="post-toc-title">文章目录</h2>
    <div class="post-toc-content">
        <nav id="TableOfContents">
  <ul>
    <li><a href="#命名约定">命名约定：</a></li>
    <li><a href="#对文件使用相对导入-lib">对文件使用相对导入 <code>lib</code></a></li>
    <li><a href="#指定类成员的类型">指定类成员的类型</a></li>
    <li><a href="#避免使用as使用is运算符">避免使用<code>as</code>，使用<code>is</code>运算符</a></li>
    <li><a href="#使用if条件代替条件表达式">使用<code>if</code>条件代替条件表达式</a></li>
    <li><a href="#使用-和操作符">使用<code>?? </code>和<code>?.</code>操作符</a></li>
    <li><a href="#使用传播集合">使用传播集合</a></li>
    <li><a href="#使用级联运算符">使用级联运算符</a></li>
    <li><a href="#使用原始字符串">使用原始字符串</a></li>
    <li><a href="#不要显式初始化变量-null">不要显式初始化变量 <code>null</code></a></li>
    <li><a href="#使用表达式函数体">使用表达式函数体</a></li>
    <li><a href="#避免print来电">避免<code>print()</code>来电</a></li>
    <li><a href="#避免对非私有的本地标识符使用前导下划线">避免对非私有的本地标识符使用前导下划线。</a></li>
    <li><a href="#使用插值组合字符串">使用插值组合字符串</a></li>
    <li><a href="#当撕下可以做的时候不要创建一个-lambda"><strong>当撕下可以做的时候不要创建一个 lambda</strong></a></li>
    <li><a href="#使用异步等待过度使用期货回调"><strong>使用异步/等待过度使用期货回调</strong></a></li>
    <li><a href="#将小部件拆分为子小部件">将小部件拆分为子小部件。</a></li>
    <li><a href="#使用-listviewbuilder-获取长列表">使用 ListView.builder 获取长列表</a></li>
    <li><a href="#在小部件中使用-const">在小部件中使用 Const</a></li>
  </ul>
</nav>
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function () {
        var postToc = $(".post-toc");
        if (postToc.length) {
            var leftPos = $("#main").offset().left;
            if(leftPos<220){
                postToc.css({"width":leftPos-10,"margin-left":(0-leftPos)})
            }

            var t = postToc.offset().top - 20,
                a = {
                    start: {
                        position: "absolute",
                        top: t
                    },
                    process: {
                        position: "fixed",
                        top: 20
                    },
                };
            $(window).scroll(function () {
                var e = $(window).scrollTop();
                e < t ? postToc.css(a.start) : postToc.css(a.process)
            })
        }
    })
</script>
    <article class="post">
        <header>
            <h1 class="post-title">《在Flutter中的开发小技巧2》</h1>
        </header>
        <date class="post-meta meta-date">
            2021年6月24日
        </date>
        
        <div class="post-meta">
            <span>|</span>
            
            <span class="meta-category"><a href='/categories/flutter'>flutter</a></span>
            
        </div>
        
        
        <div class="post-meta">
            <span id="busuanzi_container_page_pv">|<span id="busuanzi_value_page_pv"></span><span>
                    阅读</span></span>
        </div>
        
        
        <div class="clear" style="display: none">
            <div class="toc-article">
                <div class="toc-title">文章目录</div>
            </div>
        </div>
        
        <div class="post-content">
            <blockquote>
<p>本文主要介绍flutter中的开发技巧2</p>
</blockquote>
<p>30 silder</p>
<p>
        <a data-fancybox="gallery" href="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210724215501245.png">
            <img class="mx-auto" alt="image-20210724215501245" src="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210724215501245.png" />
        </a>
    </p>
<p>29chip</p>
<p>
        <a data-fancybox="gallery" href="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210724215549320.png">
            <img class="mx-auto" alt="image-20210724215549320" src="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210724215549320.png" />
        </a>
    </p>
<p>28 aspect ratio</p>
<p>
        <a data-fancybox="gallery" href="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210724215635974.png">
            <img class="mx-auto" alt="image-20210724215635974" src="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210724215635974.png" />
        </a>
    </p>
<p>27placehold 占位符</p>
<p>
        <a data-fancybox="gallery" href="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210724215726217.png">
            <img class="mx-auto" alt="image-20210724215726217" src="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210724215726217.png" />
        </a>
    </p>
<p>26flutter localizations</p>
<p>
        <a data-fancybox="gallery" href="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210724215824244.png">
            <img class="mx-auto" alt="image-20210724215824244" src="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210724215824244.png" />
        </a>
    </p>
<p>25flutter toast</p>
<p>
        <a data-fancybox="gallery" href="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210724220020961.png">
            <img class="mx-auto" alt="image-20210724220020961" src="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210724220020961.png" />
        </a>
    </p>
<p>24</p>
<p>pubspec assist 插件</p>
<p>23</p>
<p>better comments 插件</p>
<p>22</p>
<p>future.delayed</p>
<p>
        <a data-fancybox="gallery" href="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210724220319028.png">
            <img class="mx-auto" alt="image-20210724220319028" src="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210724220319028.png" />
        </a>
    </p>
<p>21 theme mode</p>
<p>20 trans form</p>
<p>
        <a data-fancybox="gallery" href="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210724220436351.png">
            <img class="mx-auto" alt="image-20210724220436351" src="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210724220436351.png" />
        </a>
    </p>
<p>19gridview</p>
<p>
        <a data-fancybox="gallery" href="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210724220556306.png">
            <img class="mx-auto" alt="image-20210724220556306" src="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210724220556306.png" />
        </a>
    </p>
<p>18 spacer</p>
<p>17 divide</p>
<p>16 url lanucher</p>
<p>
        <a data-fancybox="gallery" href="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210724220706608.png">
            <img class="mx-auto" alt="image-20210724220706608" src="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210724220706608.png" />
        </a>
    </p>
<p>15 image_picker</p>
<p>
        <a data-fancybox="gallery" href="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210724220732753.png">
            <img class="mx-auto" alt="image-20210724220732753" src="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210724220732753.png" />
        </a>
    </p>
<p>
        <a data-fancybox="gallery" href="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210724221004889.png">
            <img class="mx-auto" alt="image-20210724221004889" src="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210724221004889.png" />
        </a>
    </p>
<p>14</p>
<p>material.io  <a href="https://material.io/">https://material.io/</a></p>
<p><a href="https://www.youtube.com/redirect?event=video_description&amp;redir_token=QUFFLUhqbXFsbENJakpoZXNfNDk0Ri1INDhQbG81bktKUXxBQ3Jtc0trYmZESy1LZUN3N1RPbTl3RDRSTnVueXYtQ0VoU0FzR0xjSG83ZVJwVEJ6RnpKbXFuTEtleHhHcG9fRHZDRHdMM3VjaHhXQ2ZESUNld0hBSktQRjlOVEdZbGpDV0tRMUJOSzZXaUhEOWlqQUw2NGVZUQ&amp;q=https%3A%2F%2Fmaterial.io%2F">https://material.io/</a></p>
<p>13</p>
<p>
        <a data-fancybox="gallery" href="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210724221239881.png">
            <img class="mx-auto" alt="image-20210724221239881" src="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210724221239881.png" />
        </a>
    </p>
<p>12</p>
<p>
        <a data-fancybox="gallery" href="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210724221311502.png">
            <img class="mx-auto" alt="image-20210724221311502" src="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210724221311502.png" />
        </a>
    </p>
<p>11 image preview</p>
<p>10 listwheel scrollview</p>
<p>
        <a data-fancybox="gallery" href="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210724221348671.png">
            <img class="mx-auto" alt="image-20210724221348671" src="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210724221348671.png" />
        </a>
    </p>
<p>9</p>
<p>pageview</p>
<p>8mouseregin</p>
<p>
        <a data-fancybox="gallery" href="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210724221845509.png">
            <img class="mx-auto" alt="image-20210724221845509" src="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210724221845509.png" />
        </a>
    </p>
<p>7opacity</p>
<p>6</p>
<p>
        <a data-fancybox="gallery" href="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210724221932915.png">
            <img class="mx-auto" alt="image-20210724221932915" src="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210724221932915.png" />
        </a>
    </p>
<p>5</p>
<p>
        <a data-fancybox="gallery" href="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210724222012729.png">
            <img class="mx-auto" alt="image-20210724222012729" src="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210724222012729.png" />
        </a>
    </p>
<p>4</p>
<p>
        <a data-fancybox="gallery" href="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210724222213327.png">
            <img class="mx-auto" alt="image-20210724222213327" src="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210724222213327.png" />
        </a>
    </p>
<p>3</p>
<p>
        <a data-fancybox="gallery" href="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210724222239142.png">
            <img class="mx-auto" alt="image-20210724222239142" src="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210724222239142.png" />
        </a>
    </p>
<p>2
        <a data-fancybox="gallery" href="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210724222330515.png">
            <img class="mx-auto" alt="image-20210724222330515" src="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210724222330515.png" />
        </a>
    </p>
<p>
        <a data-fancybox="gallery" href="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210724222304026.png">
            <img class="mx-auto" alt="image-20210724222304026" src="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210724222304026.png" />
        </a>
    </p>
<p>
        <a data-fancybox="gallery" href="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210724222321284.png">
            <img class="mx-auto" alt="image-20210724222321284" src="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210724222321284.png" />
        </a>
    </p>
<p>1
        <a data-fancybox="gallery" href="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210724222354152.png">
            <img class="mx-auto" alt="image-20210724222354152" src="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210724222354152.png" />
        </a>
    </p>
<p>
        <a data-fancybox="gallery" href="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210724222445154.png">
            <img class="mx-auto" alt="image-20210724222445154" src="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210724222445154.png" />
        </a>
    </p>
<p>最佳实践是一个领域中可接受的专业标准，对于任何编程语言来说，提高代码质量、可读性、可维护性和健壮性都非常重要。</p>
<p>让我们探索一些设计和开发 Flutter 应用程序的最佳实践。</p>
<h2 id="命名约定">命名约定：</h2>
<p>类、枚举、类型定义和扩展名应该在 <code>UpperCamelCase.</code></p>
<!-- raw HTML omitted -->
<p>库、包、目录和源文件名应该在 <code>snake_case(lowercase_with_underscores).</code></p>
<!-- raw HTML omitted -->
<p>变量、常量、参数和命名参数应该在 <code>lowerCamelCase.</code></p>
<!-- raw HTML omitted -->
<h2 id="对文件使用相对导入-lib">对文件使用相对导入 <code>lib</code></h2>
<p>当同时使用相对导入和绝对导入时，当从两种不同的方式导入同一个类时，可能会造成混淆。为了避免这种情况，我们应该在<code>lib/</code>文件夹中使用相对路径。</p>
<!-- raw HTML omitted -->
<h2 id="指定类成员的类型">指定类成员的类型</h2>
<p>当成员的值类型已知时，总是指定成员的类型。<code>var</code>尽可能避免使用。</p>
<!-- raw HTML omitted -->
<h2 id="避免使用as使用is运算符">避免使用<code>as</code>，使用<code>is</code>运算符</h2>
<p>通常，<code>as</code>如果无法进行强制转换，则cast 运算符会抛出异常。为了避免抛出异常，可以使用<code>is</code>.</p>
<!-- raw HTML omitted -->
<h2 id="使用if条件代替条件表达式">使用<code>if</code>条件代替条件表达式</h2>
<p>很多时候我们需要根据Row和Column中的一些条件来渲染一个widget。如果<strong>条件表达式</strong>在任何情况下都返回 null，那么我们应该只使用 if 条件。</p>
<!-- raw HTML omitted -->
<h2 id="使用-和操作符">使用<code>?? </code>和<code>?.</code>操作符</h2>
<p>更喜欢使用 ?? （如果为空）和？。（空感知）运算符而不是条件表达式中的空检查。</p>
<!-- raw HTML omitted -->
<h2 id="使用传播集合">使用传播集合</h2>
<p>当现有项目已经存储在另一个集合中时，展开集合语法会导致代码更简单。</p>
<!-- raw HTML omitted -->
<h2 id="使用级联运算符">使用级联运算符</h2>
<p>如果我们想对同一个对象执行一系列操作，那么我们应该使用 Cascades(..) 运算符。</p>
<!-- raw HTML omitted -->
<h2 id="使用原始字符串">使用原始字符串</h2>
<p>可以使用原始字符串来避免仅转义反斜杠和美元。</p>
<!-- raw HTML omitted -->
<h2 id="不要显式初始化变量-null">不要显式初始化变量 <code>null</code></h2>
<p>在 Dart 中，当未指定变量的值时，变量会自动初始化为 null，因此添加 null 是多余且不需要的。</p>
<!-- raw HTML omitted -->
<h2 id="使用表达式函数体">使用表达式函数体</h2>
<p>对于仅包含一个表达式的函数，您可以使用表达式函数。的<code>=&gt;</code>（箭头）符号用于表达功能。</p>
<!-- raw HTML omitted -->
<h2 id="避免print来电">避免<code>print()</code>来电</h2>
<p><code>print()</code>和<code>debugPrint()</code>两个用于在控制台登录。如果您使用<code>print()</code>并且一次输出太多，那么Android有时会丢弃一些日志行。为避免这种情况，请使用<code>debugPrint().</code>如果您记录的数据有太多数据，则使用<code>dart:developer</code> <code>log().</code>这允许您在日志输出中包含更多的粒度和信息。</p>
<h2 id="避免对非私有的本地标识符使用前导下划线">避免对非私有的本地标识符使用前导下划线。</h2>
<p>Dart 在标识符中使用前导下划线 (<em>) 将成员和顶级声明标记为私有。没有概念。private 使用前导下划线 (</em>) 作为局部变量、参数、局部函数或库前缀。</p>
<h2 id="使用插值组合字符串">使用插值组合字符串</h2>
<p>使用插值使字符串更干净、更短，而不是使用长链<code>+</code>来构建字符串。</p>
<!-- raw HTML omitted -->
<h2 id="当撕下可以做的时候不要创建一个-lambda"><strong>当撕下可以做的时候不要创建一个 lambda</strong></h2>
<p>如果我们有一个函数调用一个方法，该方法的参数与传递给它的参数相同，则不需要手动将调用包装在 lambda 中。</p>
<!-- raw HTML omitted -->
<h2 id="使用异步等待过度使用期货回调"><strong>使用异步/等待过度使用期货回调</strong></h2>
<p>异步代码难以阅读和调试。该<code>async</code>/<code>await</code>语法提高了可读性。</p>
<!-- raw HTML omitted -->
<h2 id="将小部件拆分为子小部件">将小部件拆分为子小部件。</h2>
<p>当<code>setState()</code>在状态上调用时，所有后代小部件都将重建。因此，将小部件拆分为小部件，以便<code>setState()</code>调用实际需要更改 UI 的子树部分。</p>
<!-- raw HTML omitted -->
<h2 id="使用-listviewbuilder-获取长列表">使用 ListView.builder 获取长列表</h2>
<p>在处理无限列表或非常大的列表时，通常建议使用<code>ListView</code>构建器以提高性能。</p>
<p>默认<code>ListView</code>构造函数一次构建整个列表。<code>ListView.builder</code>创建一个惰性列表，当用户向下滚动列表时，Flutter 会按需构建小部件。</p>
<h2 id="在小部件中使用-const">在小部件中使用 Const</h2>
<p>当 setState 调用时小部件不会改变，我们应该将其定义为常量。它将阻止小部件重建，从而提高性能。</p>
<!-- raw HTML omitted -->
<p>我希望这能给你一些见解，使你的 Flutter 代码更具可读性，同时也提高你的应用程序的性能。快乐编码！</p>
        </div>

        


        

<div class="post-archive">
    <h2>See Also</h2>
    <ul class="listing">
        
        <li><a href="/post/Flutter/flutter%E5%AE%89%E8%A3%85%E6%95%99%E7%A8%8B/">《Flutter安装教程》</a></li>
        
        <li><a href="/post/Flutter/Flutter%E6%8F%92%E4%BB%B6awesome_dialog/">《Flutter插件awesome_dialog》</a></li>
        
        <li><a href="/post/Flutter/Flutter%E6%8F%92%E4%BB%B6%E5%AD%A6%E4%B9%A0%E7%9B%AE%E5%BD%95/">《Flutter插件学习目录》</a></li>
        
        <li><a href="/post/dart_basic/%E8%B7%AF%E7%94%B1%E4%BC%A0%E5%8F%82%E5%90%91%E4%B8%8A%E4%B8%80%E7%BA%A7%E8%BF%94%E5%9B%9E%E6%95%B0%E6%8D%AE03/">《Flutter路由传参向上一级返回数据03》</a></li>
        
        <li><a href="/post/Flutter/Flutter%E8%8E%B7%E5%8F%96%E9%80%9A%E8%AE%AF%E5%BD%95%E5%A5%BD%E5%8F%8B/">《Flutter获取通讯录好友02》</a></li>
        
    </ul>
</div>


        <div class="post-meta meta-tags">
            
            <ul class="clearfix">
                
                <li><a href='/tags/flutter'>flutter</a></li>
                
            </ul>
            
        </div>
    </article>
    
    

    
    
    <div class="post bg-white">
      <script src="https://utteranc.es/client.js"
            repo= "https://github.com/ITmxs/repo"
            issue-term="pathname"
            theme="github-light"
            crossorigin="anonymous"
            async>
      </script>
    </div>
    
</div>

                    <footer id="footer">
    <div>
        &copy; 2021 <a href="https://luckly.work/">早起的年轻人 By luckly</a>
        
        | <a rel="nofollow" target="_blank" href="http://beian.miit.gov.cn/">粤ICP备2021号-1</a>
        
    </div>
    <br />
    <div>
        <div class="github-badge">
            <a href="https://juejin.cn/user/3843548384077192" target="_black" rel="nofollow"><span class="badge-subject">Powered by</span><span class="badge-value bg-blue">掘金</span></a>
        </div>
        <div class="github-badge">
            <a href="https://space.bilibili.com/480883651" target="_black"><span class="badge-subject">Design by</span><span class="badge-value bg-brightgreen">早起的年轻人</span></a>
        </div>
        <div class="github-badge">
            <a href="https://cloud.tencent.com/developer/user/6702670" target="_black"><span class="badge-subject">Theme</span><span class="badge-value bg-yellowgreen">云社区</span></a>
        </div>
    </div>
</footer>


    
    <script type="text/javascript">
        window.MathJax = {
            tex2jax: {
                inlineMath: [['$', '$']],
                processEscapes: true
                }
            };
    </script>
    <script src='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML' async></script><script src="https://cdn.bootcdn.net/ajax/libs/fancybox/3.5.7/jquery.fancybox.min.js"></script>

<a id="rocket" href="#top"></a>
<script type="text/javascript" src='/js/totop.js?v=0.0.0' async=""></script>



    <script type="text/javascript" src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js" async></script>




    <script src='/js/douban.js'></script>
    <script src="/js/copy-to-clipboard.js"></script>

                </div>

                <div id="secondary">
    <section class="widget">
        <form id="search" action='https://luckly.work/search/' method="get" accept-charset="utf-8" target="_blank" _lpchecked="1">
      
      <input type="text" name="q" maxlength="20" placeholder="Search">
      <input type="hidden" name="sitesearch" value="https://luckly.work/">
      <button type="submit" class="submit icon-search"></button>
</form>
    </section>
    
    <section class="widget">
        <h3 class="widget-title">最近文章</h3>
<ul class="widget-list">
    
    <li>
        <a href="https://luckly.work/post/nginx/nginx%E6%96%87%E4%BB%B6%E5%86%85%E5%AE%B9/" title="Nginx文件内容">Nginx文件内容</a>
    </li>
    
    <li>
        <a href="https://luckly.work/post/nginx/nginx%E6%9E%81%E7%AE%80%E6%95%99%E7%A8%8B/" title="Nginx极简教程">Nginx极简教程</a>
    </li>
    
    <li>
        <a href="https://luckly.work/post/nginx/%E5%8D%81%E5%88%86%E9%92%9F%E5%85%A5%E9%97%A8nginx/" title="十分钟入门Nginx">十分钟入门Nginx</a>
    </li>
    
    <li>
        <a href="https://luckly.work/post/go/Goland%E8%BF%9C%E7%A8%8B%E5%BC%80%E5%8F%91%E9%85%8D%E7%BD%AE/" title="Goland远程开发配置">Goland远程开发配置</a>
    </li>
    
    <li>
        <a href="https://luckly.work/post/%E8%AF%BB%E4%B9%A6/%E5%9F%9F%E5%90%8D%E8%A7%A3%E6%9E%90/" title="域名解析">域名解析</a>
    </li>
    
    <li>
        <a href="https://luckly.work/post/git/%E6%8F%90%E4%BA%A4%E8%BF%87%E7%A8%8B%E7%9C%81%E7%95%A5%E6%9F%90%E4%BA%9B%E6%96%87%E4%BB%B6/" title="提交过程省略某些文件">提交过程省略某些文件</a>
    </li>
    
    <li>
        <a href="https://luckly.work/post/flutter_tips/Flutter_DropdownButton%E7%A4%BA%E4%BE%8B/" title="Flutter_DropdownButton示例">Flutter_DropdownButton示例</a>
    </li>
    
    <li>
        <a href="https://luckly.work/post/flutter_tips/Flutter_ExpansionPanelList%E5%92%8CExpansionPanelList.radio%E7%A4%BA%E4%BE%8B/" title="Flutter_ExpansionPanelList和ExpansionPanelList">Flutter_ExpansionPanelList和ExpansionPanelList</a>
    </li>
    
    <li>
        <a href="https://luckly.work/post/flutter_tips/Flutter%E5%BE%AE%E4%BF%A1%E5%88%86%E4%BA%AB%E9%93%BE%E6%8E%A5%E8%B7%B3%E5%9B%9EApp%E6%8C%87%E5%AE%9A%E9%A1%B5%E9%9D%A2/" title="Flutter微信分享链接跳回App指定页面">Flutter微信分享链接跳回App指定页面</a>
    </li>
    
    <li>
        <a href="https://luckly.work/post/%E4%BF%A1%E6%81%AF%E7%B3%BB%E7%BB%9F/%E5%A4%96%E5%8C%85%E5%8F%AF%E8%83%BD%E7%9A%84%E9%97%AE%E9%A2%98/" title="外包可能的问题">外包可能的问题</a>
    </li>
    
</ul>
    </section>

    

    <section class="widget">
        <h3 class="widget-title"><a href='/categories/'>分类</a></h3>
<ul class="widget-list">
    
    <li><a href="https://luckly.work/categories/Flutter/">Flutter (326)</a></li>
    
    <li><a href="https://luckly.work/categories/IT/">IT (2)</a></li>
    
    <li><a href="https://luckly.work/categories/Kotlin/">Kotlin (2)</a></li>
    
    <li><a href="https://luckly.work/categories/Mysql/">Mysql (1)</a></li>
    
    <li><a href="https://luckly.work/categories/nginx/">nginx (1)</a></li>
    
    <li><a href="https://luckly.work/categories/Vue/">Vue (6)</a></li>
    
    <li><a href="https://luckly.work/categories/YouTube%E8%A7%86%E9%A2%91%E4%B8%8B%E8%BD%BD/">YouTube视频下载 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/android/">android (6)</a></li>
    
    <li><a href="https://luckly.work/categories/dart/">dart (96)</a></li>
    
    <li><a href="https://luckly.work/categories/Flutter/">Flutter (28)</a></li>
    
    <li><a href="https://luckly.work/categories/gin/">gin (25)</a></li>
    
    <li><a href="https://luckly.work/categories/git/">git (4)</a></li>
    
    <li><a href="https://luckly.work/categories/Go/">Go (102)</a></li>
    
    <li><a href="https://luckly.work/categories/gorm/">gorm (4)</a></li>
    
    <li><a href="https://luckly.work/categories/grpc/">grpc (1)</a></li>
    
    <li><a href="https://luckly.work/categories/html/">html (3)</a></li>
    
    <li><a href="https://luckly.work/categories/ios/">ios (1)</a></li>
    
    <li><a href="https://luckly.work/categories/linux/">linux (1)</a></li>
    
    <li><a href="https://luckly.work/categories/nginx/">nginx (6)</a></li>
    
    <li><a href="https://luckly.work/categories/python/">python (35)</a></li>
    
    <li><a href="https://luckly.work/categories/read/">读书笔记 (6)</a></li>
    
    <li><a href="https://luckly.work/categories/redis/">redis (2)</a></li>
    
    <li><a href="https://luckly.work/categories/%E4%B8%AA%E4%BA%BA%E8%B5%84%E6%96%99/">个人资料 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E4%B9%A6%E5%8D%95/">书单 (8)</a></li>
    
    <li><a href="https://luckly.work/categories/%E4%B9%A6%E8%AF%84/">书评 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E4%BF%A1%E6%81%AF%E7%B3%BB%E7%BB%9F%E7%AE%A1%E7%90%86%E5%B8%88/">信息系统管理师 (19)</a></li>
    
    <li><a href="https://luckly.work/categories/%E4%BF%A1%E6%81%AF%E7%B3%BB%E7%BB%9F%E9%A1%B9%E7%9B%AE%E7%AE%A1%E7%90%86%E5%B8%88/">信息系统项目管理师 (25)</a></li>
    
    <li><a href="https://luckly.work/categories/%E5%8E%9F%E5%88%99/">原则 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E5%8E%9F%E7%94%9F%E9%80%9A%E8%AE%AF/">原生通讯 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E5%9F%BA%E7%A1%80/">基础 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E5%A4%8D%E5%88%A9%E6%95%88%E5%BA%94/">复利效应 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E5%AE%89%E8%A3%85%E6%95%99%E7%A8%8B/">安装教程 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E5%B0%91%E6%9C%89%E4%BA%BA%E8%B5%B0%E7%9A%84%E8%B7%AF/">少有人走的路 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E5%BF%83%E8%AF%AD/">心语 (3)</a></li>
    
    <li><a href="https://luckly.work/categories/%E6%8F%92%E4%BB%B6/">插件 (2)</a></li>
    
    <li><a href="https://luckly.work/categories/%E6%95%99%E5%AD%A6/">教学 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E7%8E%8B%E9%98%B3%E6%98%8E/">王阳明 (3)</a></li>
    
    <li><a href="https://luckly.work/categories/%E7%94%B5%E5%AD%90%E4%B9%A6/">电子书 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E7%99%BB%E9%99%86%E8%A1%A8%E5%8D%95/">登陆表单 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E7%A8%BB%E7%9B%9B%E5%92%8C%E5%A4%AB/">稻盛和夫 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E7%A9%B7%E7%88%B8%E7%88%B8%E5%AF%8C%E7%88%B8%E7%88%B8/">穷爸爸富爸爸 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E7%B2%BE%E8%BF%9B/">精进 (3)</a></li>
    
    <li><a href="https://luckly.work/categories/%E7%BC%96%E7%A8%8B/">编程 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E8%99%9A%E5%B9%BB/">虚幻 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E8%B4%A2%E5%8A%A1%E8%87%AA%E7%94%B1%E4%B9%8B%E8%B7%AF/">财务自由之路 (2)</a></li>
    
    <li><a href="https://luckly.work/categories/%E8%B7%91%E6%AD%A5/">跑步 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E8%B7%AF%E7%94%B1%E4%BC%A0%E5%8F%82/">路由传参 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E8%B7%AF%E7%BA%BF/">路线 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E8%BD%AF%E4%BB%B6%E5%AE%9E%E6%96%BD/">软件实施 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E9%98%B3%E6%98%8E%E5%BF%83%E5%AD%A6/">阳明心学 (3)</a></li>
    
    <li><a href="https://luckly.work/categories/%E9%A1%B9%E7%9B%AE/">项目 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E9%AD%85%E5%8A%9B/">魅力 (1)</a></li>
    
</ul>
    </section>

    <section class="widget">
        <h3 class="widget-title"><a href='/tags/'>标签</a></h3>
<div class="tagcloud">
    
    <a href="https://luckly.work/tags/flutter/">flutter</a>
    
    <a href="https://luckly.work/tags/IT/">IT</a>
    
    <a href="https://luckly.work/tags/Kotlin/">Kotlin</a>
    
    <a href="https://luckly.work/tags/Mysql/">Mysql</a>
    
    <a href="https://luckly.work/tags/nginx/">nginx</a>
    
    <a href="https://luckly.work/tags/Vue/">Vue</a>
    
    <a href="https://luckly.work/tags/YouTube%E8%A7%86%E9%A2%91%E4%B8%8B%E8%BD%BD/">YouTube视频下载</a>
    
    <a href="https://luckly.work/tags/android/">android</a>
    
    <a href="https://luckly.work/tags/dart/">dart</a>
    
    <a href="https://luckly.work/tags/flutter/">flutter</a>
    
    <a href="https://luckly.work/tags/gin/">gin</a>
    
    <a href="https://luckly.work/tags/git/">git</a>
    
    <a href="https://luckly.work/tags/go/">go</a>
    
    <a href="https://luckly.work/tags/gorm/">gorm</a>
    
    <a href="https://luckly.work/tags/grpc/">grpc</a>
    
    <a href="https://luckly.work/tags/html/">html</a>
    
    <a href="https://luckly.work/tags/ios/">ios</a>
    
    <a href="https://luckly.work/tags/linux/">linux</a>
    
    <a href="https://luckly.work/tags/nginx/">nginx</a>
    
    <a href="https://luckly.work/tags/python/">python</a>
    
    <a href="https://luckly.work/tags/redis/">redis</a>
    
    <a href="https://luckly.work/tags/%E4%B8%AA%E4%BA%BA%E8%B5%84%E6%96%99/">个人资料</a>
    
    <a href="https://luckly.work/tags/%E4%B9%A6%E5%8D%95/">书单</a>
    
    <a href="https://luckly.work/tags/%E4%B9%A6%E8%AF%84/">书评</a>
    
    <a href="https://luckly.work/tags/%E4%BF%A1%E6%81%AF%E7%B3%BB%E7%BB%9F%E7%AE%A1%E7%90%86%E5%B8%88/">信息系统管理师</a>
    
    <a href="https://luckly.work/tags/%E4%BF%A1%E6%81%AF%E7%B3%BB%E7%BB%9F%E9%A1%B9%E7%9B%AE%E7%AE%A1%E7%90%86%E5%B8%88/">信息系统项目管理师</a>
    
    <a href="https://luckly.work/tags/%E5%85%A5%E9%97%A8/">入门</a>
    
    <a href="https://luckly.work/tags/%E5%8E%9F%E5%88%99/">原则</a>
    
    <a href="https://luckly.work/tags/%E5%8E%9F%E7%94%9F%E9%80%9A%E8%AE%AF/">原生通讯</a>
    
    <a href="https://luckly.work/tags/%E5%9F%BA%E7%A1%80/">基础</a>
    
    <a href="https://luckly.work/tags/%E5%A4%8D%E5%88%A9%E6%95%88%E5%BA%94/">复利效应</a>
    
    <a href="https://luckly.work/tags/%E5%AE%89%E8%A3%85%E6%95%99%E7%A8%8B/">安装教程</a>
    
    <a href="https://luckly.work/tags/%E5%B0%91%E6%9C%89%E4%BA%BA%E8%B5%B0%E7%9A%84%E8%B7%AF/">少有人走的路</a>
    
    <a href="https://luckly.work/tags/%E5%BF%83%E8%AF%AD/">心语</a>
    
    <a href="https://luckly.work/tags/%E6%8F%92%E4%BB%B6/">插件</a>
    
    <a href="https://luckly.work/tags/%E6%95%99%E5%AD%A6/">教学</a>
    
    <a href="https://luckly.work/tags/%E7%8E%8B%E9%98%B3%E6%98%8E/">王阳明</a>
    
    <a href="https://luckly.work/tags/%E7%94%B5%E5%AD%90%E4%B9%A6/">电子书</a>
    
    <a href="https://luckly.work/tags/%E7%99%BB%E9%99%86%E8%A1%A8%E5%8D%95/">登陆表单</a>
    
    <a href="https://luckly.work/tags/%E7%A8%BB%E7%9B%9B%E5%92%8C%E5%A4%AB/">稻盛和夫</a>
    
    <a href="https://luckly.work/tags/%E7%A9%B7%E7%88%B8%E7%88%B8%E5%AF%8C%E7%88%B8%E7%88%B8/">穷爸爸富爸爸</a>
    
    <a href="https://luckly.work/tags/%E7%B2%BE%E8%BF%9B/">精进</a>
    
    <a href="https://luckly.work/tags/%E7%BC%96%E7%A8%8B/">编程</a>
    
    <a href="https://luckly.work/tags/%E8%99%9A%E5%B9%BB/">虚幻</a>
    
    <a href="https://luckly.work/tags/%E8%AF%97/">诗</a>
    
    <a href="https://luckly.work/tags/%E8%AF%BB%E4%B9%A6%E7%AC%94%E8%AE%B0/">读书笔记</a>
    
    <a href="https://luckly.work/tags/%E8%B4%A2%E5%8A%A1%E8%87%AA%E7%94%B1%E4%B9%8B%E8%B7%AF/">财务自由之路</a>
    
    <a href="https://luckly.work/tags/%E8%B7%91%E6%AD%A5/">跑步</a>
    
    <a href="https://luckly.work/tags/%E8%B7%AF%E7%94%B1%E4%BC%A0%E5%8F%82/">路由传参</a>
    
    <a href="https://luckly.work/tags/%E8%B7%AF%E7%BA%BF/">路线</a>
    
    <a href="https://luckly.work/tags/%E8%BD%AF%E4%BB%B6%E5%AE%9E%E6%96%BD/">软件实施</a>
    
    <a href="https://luckly.work/tags/%E9%80%9A%E8%AE%AF%E5%BD%95/">通讯录</a>
    
    <a href="https://luckly.work/tags/%E9%98%B3%E6%98%8E%E5%BF%83%E5%AD%A6/">阳明心学</a>
    
    <a href="https://luckly.work/tags/%E9%A1%B9%E7%9B%AE/">项目</a>
    
    <a href="https://luckly.work/tags/%E9%AD%85%E5%8A%9B/">魅力</a>
    
</div>
    </section>

    
<section class="widget">
    <h3 class="widget-title">友情链接</h3>
    <ul class="widget-list">
        
        <li>
            <a target="_blank" href="http://www.topgoer.com/" title="枯藤">枯藤</a>
        </li>
        
        <li>
            <a target="_blank" href="https://gorm.cn/zh_CN/docs/index.html" title="gorm">gorm</a>
        </li>
        
        <li>
            <a target="_blank" href="https://docs.python.org/zh-cn/3/tutorial/index.html" title="python">python</a>
        </li>
        
        <li>
            <a target="_blank" href="https://www.liwenzhou.com/" title="李文周">李文周的博客</a>
        </li>
        
        <li>
            <a target="_blank" href="http://www.xbzweb.com/" title="小包子的博客">小包子的博客</a>
        </li>
        
        <li>
            <a target="_blank" href="https://www.flysnow.org/" title="飞雪无情的博客">飞雪无情的博客</a>
        </li>
        
        <li>
            <a target="_blank" href="https://sliverhorn.com/" title="sliverhorn的博客">sliverhorn的博客</a>
        </li>
        
        <li>
            <a target="_blank" href="http://yuedu.baidu.com/ebook/14a722970740be1e640e9a3e" title="Android Gradle权威指南">Android Gradle权威指南</a>
        </li>
        
        <li>
            <a target="_blank" href="https://gesdh.cn/" title="小格子">格子导航</a>
        </li>
        
        <li>
            <a target="_blank" href="https://itachi.xyz/" title="阿林">itachi&#39;s Blog</a>
        </li>
        
        <li>
            <a target="_blank" href="https://darjun.github.io/" title="大俊">大俊Blog</a>
        </li>
        
        <li>
            <a target="_blank" href="https://geektutu.com/post/quick-golang.html" title="极客兔兔">极客兔兔Blog</a>
        </li>
        
        <li>
            <a target="_blank" href="http://zxfcumtcs.github.io/" title="赵雪峰">雪峰Blog</a>
        </li>
        
    </ul>
</section>


    <section class="widget">
        <h3 class="widget-title">其它</h3>
        <ul class="widget-list">
            <li><a href="https://luckly.work/index.xml">文章 RSS</a></li>
        </ul>
    </section>
</div>
            </div>
        </div>
    </div>
</body>

</html>